Many of today's microcontroller integrated circuits have a low power mode. Various names such as "stop", "halt", and "sleep", among others, can be used to describe this low power mode. The purpose of placing an integrated circuit in this low power mode is to reduce the overall power consumption of the integrated circuit. Because many microcontroller applications use a battery as the source of power, it is very important that the microcomputer have a mode in which it uses a minimum amount of power. For example, microcomputer applications such as pagers, watches, cellular telephones, portable computers, etc. generally require the microcomputer to consume as little power as possible.
A low power mode may utilize one or more methods to reduce the power consumption of the integrated circuit. One of the common ways to reduce power consumption of the integrated circuit is to stop some or all of the clocks used to clock the circuitry. An integrated circuit usually consumes less power when the circuitry is not being clocked.
A common way of entering a low power mode is to use a software instruction which is executed by the central processing unit (CPU). The MC68HC11 and MC68HC05 families of microcomputers, available from Motorola, Inc. of Austin, Tex., have a "stop" mode which is used as a low power mode. This stop mode is entered when the CPU executes a "STOP" instruction. The execution of this STOP instruction causes the integrated circuit to enter a low power mode in which power consumption is reduced by stopping all of the clocks on the integrated circuit.
However, if all of the clocks on the integrated circuit are stopped, the problem then arises as to how to get the integrated circuit out of stop mode. If none of the clocks on the integrated circuit are functioning, then the microcomputer cannot perform data processing functions. Thus, an integrated circuit pin that receives a signal from outside the microcomputer is generally used in order to exit stop mode. This pin receives a signal which indicates to the microcomputer that the microcomputer should restart the internal clocks and should exit stop mode.
Existing data processing systems having microcomputers can use one of a number of microcomputer pins in order to recover from stop mode. For example, Motorola's MC68HC11 and MC68HC05 microcomputers use either the reset pin or the interrupt request (IRQ) pin to exit and recover from stop mode. Asserting the reset pin causes the microcomputer to initialize itself to a predetermined reset state, regardless of the microcomputer's present state. Resetting the microcomputer to this initial state includes the step of restarting the clocks. Asserting the IRQ pin causes the microcomputer to restart the clocks and to begin executing an interrupt software routine.
Note that stop mode can also be exited by cycling the microcomputer's power source (i.e. turning the power off and then on again). But this is not generally a desirable way to exit stop mode because of other effects that result from the loss of power (e.g. the contents of some memories can be lost if power is cycled).
Unfortunately, the STOP instruction presents a serious reliability problem to applications (e.g. certain watches, pagers, telephones, etc.) that have no method available to assert the reset pin or the IRQ pin. There is no way for the person using such a product to assert pins on the microcomputer inside the product without first disassembling the product. The STOP instruction is a reliability problem to these applications because the inadvertent execution of a STOP instruction will stop the microcomputer with no apparent means available to exit stop mode and restart the microcomputer. The microcomputer will thus remain in stop mode until the product is disassembled at the repair shop. Thus, the inadvertent execution of a single STOP instruction makes the product stop working. Obviously, this is not acceptable to product users or manufacturers.
There are two primary causes for the inadvertent execution of a STOP instruction. The first cause is a software error, such as runaway software or an erroneous STOP instruction, that mistakenly directs the CPU to execute a STOP instruction. The second cause is some type of electrical disturbance, such as noise or electrostatic discharge. As an example, the register or latches containing the binary code of a new instruction to be executed by the CPU can be subject to an electrical disturbance. If the electrical disturbance changes one or more of the bits of the binary code, the register may erroneously contain the binary code for a STOP instruction. The CPU will thus execute a STOP instruction that the user did not intend and did not include in the software program.
As an added layer of protection some microcomputers, such as Motorola's MC68HC11, use one or both of the following safeguards against an inadvertent STOP instruction. The first safeguard is a register control bit to disable the STOP instruction. If the user programs the control bit to be a first binary state, the STOP instruction will carry out its intended function and will stop the clocks. But if the user programs the bit to be the other binary state, the STOP instruction will not be performed and the clocks will not be stopped.
The second safeguard is a clock monitor circuit to recover from an inadvertent STOP instruction. The clock monitor circuit resets the microcomputer based on an internal RC (resistor-capacitor) delay if the clocks become too slow or stop. A control bit is used to enable or disable the clock monitor circuit, depending upon whether the user wants to allow the microcomputer to enter stop mode.
The disadvantage of both of these safeguards is that each requires the use of a software accessible control bit that must be in the proper state. But if the source of the problem is runaway software that inadvertently executes a STOP instruction, the runaway software may also inadvertently change the value of the control bit. Both of these safeguards make it less likely that runaway software will enter stop mode because two steps, rather than one step, must now be performed in order to enter stop mode. That is, in order to inadvertently enter stop mode, first a control bit must be placed in the proper state, and then the STOP instruction must be executed. Although both of these safeguards offer some improvement, they are unfortunately still susceptible to runaway software.